package com.itlong.cloud.enumerate.ecode;

import lombok.Getter;
import lombok.Setter;

/**
 * <desc>
 *      与旺龙一卡通对接错误码定义
 * </desc>
 *
 * @createDate 2017/10/2722
 */
public enum SmartCardErrorCodeEnum {
	
	/**
	 * mainCode为5表示一卡通模块错误，subCode可用范围为1至999；
	 */
	USER_LOGIN_ERROE(5,999,"用户名或密码错误"),
    USER_TOKEN_ERROR(5,998,"获取不到用户token"),
    USER_AUTH_ERROR(5,997,"用户没有权限"),
    /*公用  subCode可用范围为1~99*/
    PUB_PROJECT_ID_EMPTY_ERR(5,1,"项目编号不能为空"),
    NOT_PARAM(5,2,"参数不匹配"),
	PROJECT_ID_INVALID_ERR(5,3,"项目编号不合法"),
    PROJECT_NAME_INVALID_ERR(5,4,"项目名称不合法"),
    PROJECT_NOT_EXISTS_ERR(5,5,"项目编号不存在"),

    /*与旺龙一卡通对接  subCode可用范围为100~199*/
    SERIALNUNBER_EMPTY_ERR(5,100,"同步流水号不能为空"),
    SYNCDATA_EMPTY_ERR(5,101,"待同步数据不能为空"),
    LOGIN_PARAM_ERR(5,102,"登录参数认证失败"),
    DATA_TYPE_ERR(5,103,"数据类型不能为空"),
    PROJECT_NONE_CERTIFICATE(5,104,"项目下无证书"),
    ELEVATOR_AUTH_ERR(5,105, "电梯权限格式错误"),

    //与C#人脸识别交互
    C_LOGIN_PROJECT_NOT_EXISTS(5,201,"该项目不存在，请检测项目编号！"),
    C_LOGIN_ENGINEER_VERIFY_PROJECT_FAIL(5,202,"您的工程人员账号，没有权限管理该项目！"),
    ;

    @Setter
    @Getter
    private ErrorCode errorCode = new ErrorCode();

	SmartCardErrorCodeEnum(){}

    /** 主错误码与错误信息构造函数
     *
     * @param mainCode
     */
	SmartCardErrorCodeEnum(Integer mainCode, String codeMsg) {
        errorCode.setMainCode(mainCode);
        errorCode.setSubCode(0);
        errorCode.setCodeMsg(codeMsg);
    }

    /** 全参构造函数
     *
     * @param mainCode
     * @param subCode
     */
	SmartCardErrorCodeEnum(Integer mainCode, Integer subCode, String codeMsg){
        errorCode.setMainCode(mainCode);
        errorCode.setSubCode(subCode);
        errorCode.setCodeMsg(codeMsg);
    }

}
